<?php Yii::app()->getClientScript()->registerScriptFile(Yii::app()->baseUrl.'/js/iwork.js'); ?>
<?php Yii::app()->getClientScript()->registerScriptFile(Yii::app()->baseUrl.'/js/errorReport.js'); ?>
<?php Yii::app()->getClientScript()->registerScriptFile(Yii::app()->baseUrl.'/js/tinymce/jscripts/tiny_mce/tiny_mce.js'); ?>
<?php Yii::app()->clientScript->registerScriptFile('/js/reveal-master/jquery.reveal.js'); ?>
<?php Yii::app()->clientScript->registerCssFile('/js/reveal-master/reveal.css'); ?>
<script type="text/javascript">
    tinyMCE.init({
        mode : "exact",
        elements : "errorText",
        theme : "advanced",
        skin : "default",
        width : "520",
        height : "210",
        invalid_elements: "img, a, script, h1, h2, h3, h4, h5, h6, h7, font, iframe, object",
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
        theme_advanced_toolbar_location : false,
        theme_advanced_toolbar_align : false,
        theme_advanced_statusbar_location : false,
        theme_advanced_resizing : false,
        convert_urls : false,
        relative_urls : false
    });
</script>

<?php $params = array('catId'=>$cat['catId'], 'partnerUrl'=>$partner['url']); ?> 
<div class="padding4020">
<div class="partner_profil_header">
    <div class="partner_cat"><a href="<?php echo Yii::app()->createUrl('partner/default/cat', array('catId'=>$cat['catId']));?> "> <?php echo $cat['name']; ?></a></div>

<?php if(!empty($subCats)) : ?>
    &nbsp;&nbsp;
   <ul  class="inline unstyled profile_partner_subcats">
    <?php for($i=0; $i<count($subCats); $i++) : ?>
          <li class="subcats<?php echo $i;  ?>">
            <?php echo CHtml::link($subCats[$i]['name'], Yii::app()->createUrl('partner/default/cat', array('catId'=>$subCats[$i]['catId'], 'parentId'=>$subCats[$i]['parentId']))); ?>
         </li>&nbsp;&nbsp;
    <?php endfor; ?>
        
        
              </ul>
        
        
<?php endif; ?>
<span class="cat_banner pull-right ">
        <?php if(!empty($advertCode)) : ?>
            <?php echo $advertCode; ?>
        <?php else : ?>
            <img src="/images/banners/cat_banner.png" alt="">
        <?php endif; ?>
    </span><div class="clearfix"></div>



<a href="#modalErrorReport" class="error_report pull-right" data-toggle="modal" > Сообщить об ошибке </a>
</div>
    <div class="clearfix"></div>
    <h2 class="partner_name"><?php echo $partner['name'];?> <img class="work_partner"  id="<?php echo Yii::app()->user->isGuest ? 'unregIWork' : 'iWork' ; ?>" src="<?php echo $userIsWork ? '/images/prettyImg/confirm_color.png' : '/images/prettyImg/confirm_gray.png'; ?>"/></h2> 
<?php if(!empty($relProfiles)) : ?>    
    <p class="others_cat">В других категорих:
         <?php $count=count($relProfiles); $i = 0; ?>
    <?php foreach ($relProfiles as $item) : ?>
        
        <a href="<?php echo $item['url'];?>"><?php echo $item['title']; ?></a>
         <?php   $i++; if($i != $count && $count!=1) echo(',&nbsp;');  ?>
    <?php endforeach; ?>
    </p>
<?php endif;?>
    
    
</div>
<div id="modalErrorReport" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">Заполните форму</h3>
    </div>
    <div class="modal-body">
        <?php echo CHtml::beginForm('', 'post', array('class'=>'errorForm')); ?>
            <?php echo CHtml::activeLabel($errorModel, 'text'); ?>
            <?php echo CHtml::activeTextArea($errorModel, 'text', array('id'=>'errorText')); ?>
            <?php if(Yii::app()->user->isGuest || !Yii::app()->user->getState('email', 0)) : ?>
                <?php echo CHtml::activeLabel($errorModel, 'email'); ?>
                <?php echo CHtml::activeTextField($errorModel, 'email', array('class'=>'errorEmail')); ?>
            <?php else : ?>
                <?php echo CHtml::activeHiddenField($errorModel, 'email', array('value'=>Yii::app()->user->getState('email'), 'class'=>'errorEmail')); ?>
            <?php endif; ?>
            <?php echo Yii::app()->user->isGuest ? 
                    CHtml::activeLabel($errorModel, 'login').CHtml::activeTextField($errorModel, 'login', array('class'=>'errorLogin')) : CHtml::activeHiddenField($errorModel, 'login', array('value'=>Yii::app()->user->getState('login'), 'class'=>'errorLogin')) ; ?>
            <?php echo CHtml::activeHiddenField($errorModel, 'partnerId', array('value'=>$partner['partnerid'])); ?>
        <br/>
            <?php echo CHtml::submitButton('Отправить',array('class'=>'addpst')); ?>
       <?php echo CHtml::endForm(); ?>
    </div>
</div>

<?php if($show_tabs)  { ?>
<ul id="tabs">
  
    <li class="first <?php if($curent=='profile') echo ('activ_tab');  ?>" >
     <a class="<?php if( ($curent=='invite')  || ( $curent=='news' && $partner['type'] != 'Система инвайтов')  )echo ('befor_activ_tab');  ?>" href="<?php echo Yii::app()->createUrl('partner/profile/index', $params); ?>">Обзор</a>
    </li>
    <?php if($partner['type'] == 'Система инвайтов') : ?>
    <li class="<?php if($curent=='invite') echo ('activ_tab');  ?>" >
    <a class="<?php if($curent=='news') echo ('befor_activ_tab');  ?>"  href="<?php echo Yii::app()->createUrl('partner/profile/invite', $params); ?>">Инвайты</a> 
    </li>      
    <?php endif; ?>
   <li class="<?php if($curent=='news') echo ('activ_tab');  ?>" > 
            <a class="<?php if($curent=='forum') echo ('befor_activ_tab');  ?>" href="<?php echo Yii::app()->createUrl('partner/news/allnews', $params); ?>">Новости и аналитика</a>
    </li> 
        <li class="<?php if($curent=='forum') echo ('activ_tab');  ?>">  
            <a class="last"  href="<?php echo Yii::app()->createUrl('partner/forum/index', $params); ?>">Мини-форумы</a>
        </li>
        <?php if(!empty($theme)) : ?>
            <li class="active">
                <a class="last" href="">ТЕМА: <?php echo $theme->title; ?></a> 
            </li>  
           <?php endif; ?>   
</ul>


<div class="tabs_wraper">
</div>
<?php } ?>



<img style="position: absolute; display: none;" class="tooltipPointer" src="/images/prettyImg/tt_link.png"/>
<span class="tooltipMessage" style="display: none; border: 5px solid #ff8400;position: absolute; width:200px; padding: 10px; background-color: white; text-align: center ">Если вы работаете в этой партнеркой, нажмите</span>

<div class="flashMessage" style="display: none; width: 600px; padding-left: 50px; padding-bottom: 10px; padding-top: 10px; position: absolute; border: 2px solid blue; background-color: #9aafe5;">    
    <span class="message"></span>
    <span style="cursor: pointer; position: absolute; top: 0px; left: 98%" class="closeFlashMessage" title="Закрыть">X</span>
</div>

<div id="iworkEror" style="display: none; width: 600px; padding-left: 50px; padding-bottom: 10px; padding-top: 10px; position: absolute; border: 2px solid blue; background-color: #9aafe5;">    
    <span class="iworkMessage">Для того, чтобы добавить эту партнерскую программу в ваш список необходимо <a href="<?php echo Yii::app()->createUrl('user/default/signup'); ?>">зарегистрироваться</a>.
        <?php $this->widget('application.widgets.UloginWidget', array(
            'params'=>array(
                'id'=>'uLogin1',
                'redirect'=>'http://'.$_SERVER['HTTP_HOST'].'/index.php?r=ulogin/login' 
            )
        )); ?> 
    </span>
    <span style="cursor: pointer; position: absolute; top: 0px; left: 98%" class="closeFlashMessage" title="Закрыть">X</span>
</div>
<?php echo CHtml::hiddenField('', $partner['partnerid'], array('id'=>'partnerid')); ?>